<!DOCTYPE html>
<html lang="en">
	<head>
		<title>米迪</title>
		<meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" href="__Admin__/css/bootstrap.min.css" />
		<link rel="stylesheet" href="__Admin__/css/bootstrap-responsive.min.css" />
		<link rel="stylesheet" href="__Admin__/css/unicorn.main.css" />
		<link rel="stylesheet" href="__Admin__/css/unicorn.grey.css" class="skin-color" />	
		<script src="__Admin__/js/jquery.min.js"></script>
		<script type="text/javascript" >
		   $(function(){
			   $(".control-group").find(".widget-title :checkbox").bind("click",function(){
					  if(this.checked==true){
						  $(this).parents(".widget-title").siblings().find(":checkbox").attr("checked",true);
					  }else{
						  $(this).parents(".widget-title").siblings().find(":checkbox").attr("checked",false); 
					  }
				   });
			   $('#guanliyuan_text1_right').change(function(){
				       $(".widget-box").find(":checkbox").attr("checked",false);
					   var uid=$(this).children('option:selected').val();
					   var uname=$(this).children('option:selected').text();
					   if(uname=="请选择"){
						   alert("请选择用户");
						   return false;
					   }
					   var url="__URL__/showright";
					   $.post(url,{"uid":uid},function(myret){ 				  
		     				var jsonRet=$.parseJSON(myret);
		     				if(jsonRet.ret==0){
		     					for(i=0;i<jsonRet.data.bigcate.length;i++){
		     						$("#bigcate"+jsonRet.data.bigcate[i]).parents(".control-group").find(":checkbox").attr("checked",true);
		     					}
		     					for(i=0;i<jsonRet.data.smallcate.length;i++){
		     						$("#"+jsonRet.data.smallcate[i]+"").attr("checked",true);
		     					}
		     				}else{
		     					alert(jsonRet.message);
		     				}
                   });
			    });
		   });
		</script>
	</head>
	<body>
      <include file="Public/head" />
		<div id="content">
			<div id="content-header">
				<h1>权限设置</h1>
			</div>
			<div id="breadcrumb">
				<a href="#" class="current">权限设置</a>
			</div>
			
			<div class="container-fluid">
				<div class="row-fluid">
					<div class="span12">
						<div class="widget-box">
							<div class="widget-title">
								<span class="icon">
									<i class="icon-align-justify"></i>									
								</span>
								<h5>权限设置</h5>
								
							</div>
							<div class="widget-content nopadding">
								<form class="form-horizontal" method="post" action="{:U('Linux/setright')}" name="basic_validate" id="basic_validate">    
                                    <div class="widget-title" style="margin-top:10px;height:auto;">
									<span style="margin-left:50px;"><b>管理员</b></span>
									<select id="guanliyuan_text1_right" name="userid" style="margin-left:25px;width:300px;">
											     <option value="">请选择</option>
											     <volist name="class" id="vo">
													<option value="{$vo.uid}">{$vo.username}</option>
												 </volist>
							        </select>
								      </div>
                                      <volist name="right" id="vo" key="k">
	                                      <div class="control-group">
	                                           <div>
	                                            <div class="widget-title" style="margin-top:10px;">
													<span class="icon">
														<input type="checkbox" name="bigcate{$vo.bigaction}" value="{$vo.bigaction}" id="bigcate{$vo.bigaction}"/>									
													</span>
													<h5>{$vo['bigcategroyname']}</h5>
										       </div>
										       <volist name="vo['smallinfo']" id="myvo" key="myk">
										          <div style="float:left;">
		                                        <label class="control-label">{$myvo['smallcategroy']}</label>
		                                        <div class="controls">
		                                            <input type="checkbox" id="{$vo.bigaction}-{$myvo.smallaction}" name="smallcate{$vo.bigaction}-{$myvo.smallaction}" value="{$vo.bigaction}-{$myvo.smallaction}"/>
		                                        </div>
	                                        </div>	                    
                                                </volist>
                                                <div style="clear:both;"></div>
                                                </div>
                                           </div> 
                                      </volist>
                                     <div class="form-actions">
                                        <input type="submit" value="提交" class="btn btn-primary" />
                                    </div>
                                </form>
							</div>
						</div>			
					</div>
				</div>		
			</div>
		</div>
            <include file="Public/foot" />
            <script src="__Admin__/js/jquery.min.js"></script>
            <script src="__Admin__/js/jquery.ui.custom.js"></script>
            <script src="__Admin__/js/bootstrap.min.js"></script>
            <!-- <script src="__Admin__/js/jquery.uniform.js"></script> -->
            <script src="__Admin__/js/select2.min.js"></script>
            <script src="__Admin__/js/jquery.dataTables.min.js"></script>
            <script src="__Admin__/js/unicorn.js"></script>
            <script src="__Admin__/js/unicorn.tables.js"></script>
	</body>
</html>